#ifndef CleanSelf_H
#define CleanSelf_H

#define CSELF_END 0
#define CSELF_ACT 1
#define CSELF_COOL 2
#define CSELF_FAN 3
#define CSELF_HEAT_L 4
#define CSELF_HEAT_H 5

#ifdef CleanSelf_Variable
#define CleanSelf_Extern

#else
#define CleanSelf_Extern extern
#endif


typedef enum
{
  CleanOff=0,
  CleanOn,
  StartCleanMax
}StartCleanType;

typedef enum
{
  None=0,            // 没有关自清洁信号
  PowerOnOffGenerateCleanOff, // 开关机切换导致关掉自清洁
  ErrGenerateCleanOff,//保护或故障功能生效时（防冻结保护除外）
  ReceiveCleanOffMessageGenerateCleanOff,// 接收到自清洁关闭信号
  CleanFinishGenerateCleanOff, //执行自清洁完成
  CleanOffMax
}CleanSelfOffType;

typedef struct
{
  CleanSelfOffType OffCleanFlag;
  U8 OutCleanStartFlag; // 外机开始运行自清洁标志
  StartCleanType CleanStartFlag; // 外机开始运行自清洁标志
  U16 RunTime; // 运行时间
}CleanSelfTyoe;

extern CleanSelfTyoe  CleanSelfData;

CleanSelf_Extern U8 stat_CleanSelf; /* 自清洁模式状态 */

CleanSelf_Extern ram_byte CSelfFlag;
#define f_CleanSelf CSelfFlag.bit.b0 /* 自清洁模式标志 */
#define f_OutCSelf CSelfFlag.bit.b1  /* 外机支持自清洁模式标志 */

void CleanSelf( void );
void CleanSelfMode( void );
void CleanSelfAct(void);

#endif
